#include "CControlDlg.h"
#include "ui_CControlDlg.h"

namespace Ui{
	class CControlDlgClass;
}
Ui::CControlDlgClass ui;

#pragma execution_character_set("utf-8")
CControlDlg::CControlDlg(ControlType type,QWidget *parent)
	: QWidget(parent),m_control_type{type}
{
	ui.setupUi(this);
	OnInitDialog();
}

CControlDlg::~CControlDlg()
{}

void CControlDlg::SetOpenBtnName(const QString & text)
{
	ui.pushButton_open->setText(text);
}

void CControlDlg::SetCloseBtnName(const QString& text)
{
	ui.pushButton_close->setText(text);
}

void CControlDlg::SetGroupTitle(const QString& title)
{
	ui.groupBox->setTitle(title);
}

void CControlDlg::OnInitDialog()
{
	this->setWindowFlags(Qt::FramelessWindowHint | Qt::MSWindowsFixedSizeDialogHint);
	connect(ui.pushButton_open, &QPushButton::clicked, this, &CControlDlg::signal_open_clicked,Qt::UniqueConnection);
	connect(ui.pushButton_close, &QPushButton::clicked, this, &CControlDlg::signal_close_clicked,Qt::UniqueConnection);
}
